﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using Company.BLL;
using Company.Model;
using Company.IBLL;
using System.Web.Security;
using Newtonsoft.Json;

namespace Evaluate.UI.Controllers
{
    [RoutePrefix("api/accounts")]
    public class ValuesController : ApiController
    {
        private IUserService UserService = Company.BLLContainer.Container.Resolve<IUserService>();
        // GET api/values



        /// <summary>
        /// 加载全部的区域
        /// </summary>
        /// <param name="p"></param>
        /// <returns></returns>
        private IT_EALocationServer locationServer = Company.BLLContainer.Container.Resolve<IT_EALocationServer>();
        public List<T_EALocation> GetLocation(T_EALocation p)
        {
            var date = locationServer.GetLocation(p);
            return date;
        }

        
        private IT_EAIndoorService EAIndoorService = Company.BLLContainer.Container.Resolve<IT_EAIndoorService>();
        [HttpGet]
        public List<T_EAIndoor> EAIndoor()
        {
            var data = EAIndoorService.EAIndoor();
            
            return data;
        }



        private IT_DictionaryServer DictionaryServer = Company.BLLContainer.Container.Resolve<IT_DictionaryServer>();
        [HttpGet]
        public List<T_Dictionary> GetDictionaryList(string type)
        {
            var data = DictionaryServer.GetDictionary(type);
            var result = JsonConvert.DeserializeObject<List<T_Dictionary>>(JsonConvert.SerializeObject(data));
            return result;
        }




    }
}
